<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 第一个参数直接起到累计的功能
        let nums = [1,3,5,7];
        let total = nums.reduce((initVal, num) => {
            return initVal + num;
        }, 5);
        console.log(total);
    </script>
</body>
</html>